Skip to content

Conversation

madsodgaard
Copy link

Introduces a C shim to erase the pointer type of stdio types, that are different across Android versions.

With this addition swift-log and any packages that use it can be compiled on Android 23+

Resolves #374

// These C functions will be called from Swift. They provide a stable
// interface, hiding the pointer type differences between Android versions.

void *shim_stdout(void);
Copy link
Member

@weissi weissi Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally, given them a little more unique prefixes. Maybe swift_log_android or smth. The alternative is to make them static inline functions and define them in the .h file which means they'll be inlined entirely and won't get a symbol at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we can do this for all platforms, no need to special-case Android

@ktoso ktoso added the 🔨 semver/patch No public API change. label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Android 23
3 participants